module V{
    /** 玩家界面 */
    export class BuyuPlayerView extends PlayerView{
        /** 炮 */
        public gun:eui.Image;
        /** 炮的值 */
        private txtgun:eui.Label;
        /** 鱼币数量 */
        private txtgold:eui.Label;
        /** 玩家昵称 */
        public txtname:eui.Label;
        /** 加炮按钮 */
        private btadd:eui.Button;
        /** 减炮按钮 */
        private btless:eui.Button;

        /** 更新炮值 身上鱼币 */
        public upValue(v:number, g:number = 0):void{
            //console.log("upValue", this.chairId, v, g);
            v && (this.txtgun.text = v.toString());
            if(this.getData()){
                this.getData().score += g;
                this.txtgold.text = this.getData().score.toString();
            }
        }

        /** 显示玩家 */
        public show():boolean{
            if(this.getData()){
                this.txtgold.text = this.getData().score.toString();
                this.txtname.text = this.getData().nickName;
            }
            if(this.isMe()){
                this.btadd.visible = this.btless.visible = true;
            }else{
                this.btadd.visible = this.btless.visible = false;
            }
            return super.show();
        }

    }
}